import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import '../pages/detail_page/details_top_area.dart';
import '../pages/detail_page/details_explain.dart';
import '../pages/detail_page/details_tabbar.dart';

class DetailPage extends StatelessWidget {
  final String goodsId;
  DetailPage(this.goodsId);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('详情'),
        leading: IconButton(icon: Icon(Icons.arrow_back) , onPressed: (){
          Navigator.pop(context);
        }),
      ),
      body: Stack(
        children: <Widget>[
          Container(
              child: ListView(
                children: <Widget>[
                  DetailTopArea(),
                  DetailsExplain(),
                  DetailsTabbar()
                ],
              )
          ),
          Positioned(
            bottom: 0,
            left: 0,
            child: _detailsBottom()
          ),
        ],
      )
    );
  }

  Widget _detailsBottom (){
    return Container(
      width: ScreenUtil().setWidth(750),
      height: ScreenUtil().setHeight(80),
      color: Colors.white,
      child: Row(
         children: <Widget>[
           InkWell(
             onTap: (){},
             child: Container(
               width: ScreenUtil().setWidth(110),
               alignment: Alignment.center,
               child: Icon(
                 Icons.shopping_cart,
                 size: 35,
                 color: Colors.red,
               ),
             ),
           ),
           InkWell(
             onTap: (){},
             child: Container(
               width: ScreenUtil().setWidth(320),
               height: ScreenUtil().setHeight(80),
               alignment: Alignment.center,
               color: Colors.green,
               child: Text(
                 '加入购物车',
                 style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(28)),
               )
             ),
           ),
           InkWell(
             onTap: (){},
             child: Container(
                 width: ScreenUtil().setWidth(320),
                 height: ScreenUtil().setHeight(80),
                 alignment: Alignment.center,
                 color: Colors.red,
                 child: Text(
                   '立即购买',
                   style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(28)),
                 )
             ),
           )
         ],
      ),
    );
  }
}
